package rursu.business.beans;

import rursu.business.R;

public enum Certification {
	
	CERTIFICATION_R("R") {

		@Override
		public int getResource() {
			return R.drawable.certificate_r;
		}

		@Override
		public String getName() {
			return this.certificationName;
		}
		 
	},
	
	CERTIFICATION_PG13("PG-13") {
		
		@Override
		public int getResource() {
			return R.drawable.certificate_pg13;
		}

		@Override
		public String getName() {
			return this.certificationName;
		}
		
	};
	
	protected String certificationName; 
	public abstract int getResource();
	public abstract String getName();
	
	Certification(String name) {
		this.certificationName = name;
	}
	
	public static Certification getCertificationt(String value) {
		
		if (value.equalsIgnoreCase(Certification.CERTIFICATION_PG13.getName())) {
			return Certification.CERTIFICATION_PG13;
		}
		
		if (value.equalsIgnoreCase(Certification.CERTIFICATION_R.getName())) {
			return Certification.CERTIFICATION_R;
		}
		
		return null;
	}
	
}